import request from '@/utils/request'

/**
 * 获取部门负责人
 */

export const getEmployeeSimpleApi = () => {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * 获取员工列表
 */
export const getEmployeesListApi = (data) => {
  return request({
    method: 'get',
    url: '/sys/user',
    params: data
  })
}

/**
 * 删除
 */
export const delEmployeesApi = (id) => {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

/**
 * 添加员工
 */

export const addEmployeesApi = data => {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}

/**
 * 批量上传文件
 */
export const uploadEmployeesApi = data => {
  return request({
    method: 'post',
    url: '/sys/user/batch',
    data
  })
}

/**
 * 更新员工信息
 */
export const editEmployeesApi = data => {
  return request({
    method: 'put',
    url: `/sys/user/${data.id}`,
    data
  })
}
/**
 * 修改角色
 */
export const editRoleApi = data => {
  return request({
    method: 'put',
    url: '/sys/user/assignRoles',
    data
  })
}
